<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>TZ-追梦</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        #box{
            width:200px;
            height: 200px;
            border: 1px dashed black;
            margin: 100px auto;
            padding:100px;
            perspective: 800px;
        }
        #wrap{
            width:200px;
            height: 200px;
            border: 1px dashed black;
            transition: 5s;
            position: relative;

            transform-style: preserve-3d;
            transform-origin: center center -100px;
        }

        #wrap div{
            position: absolute;
            width:200px;
            height: 200px;
            text-align: center;
            line-height: 200px;
            box-shadow:inset 0 0 25px rgba(0,0,0,0.4);
        }
        #wrap div:nth-child(1){
            top:-200px;
            transform-origin: bottom;
            transform: rotateX(90deg);
        }
        #wrap div:nth-child(2){
            top:200px;
            transform-origin: top;
            transform: rotateX(-90deg);
        }
        #wrap div:nth-child(3){
            top:0;
            left:0;

        }
        #wrap div:nth-child(4){
            top:0;
            left:0;

            transform: translateZ(-200px);
        }
        #wrap div:nth-child(5){
            top:0;
            left:-200px;
            transform-origin: right;
            transform: rotateY(-90deg);
        }
        #wrap div:nth-child(6){
            top:0;
            left:200px;
            transform-origin: left;
            transform: rotateY(90deg);
        }
        #box:hover > div{
            transform: rotateY(180deg);
        }
    </style>
</head>
<body>
    <div id="box">
        <div id="wrap">
            <div>上</div>
            <div>下</div>
            <div>前</div>
            <div>后</div>
            <div>左</div>
            <div>右</div>
        </div>
    </div>

</body>
</html>